package com.aaa.day1109.demo03;

import java.util.ArrayList;

/**
 * @author ${崔灿}
 * @date 2022/11/09 18:05
 **/

public class AAAPublic implements IPublic{
    private String msg;
    private ArrayList<UserInterface> list=new ArrayList<UserInterface>();
    @Override
    public void guanzhu(UserInterface userInterface) {
        list.add(userInterface);
    }

    @Override
    public void quxiao(UserInterface userInterface) {
        list.remove(userInterface);
    }

    @Override
    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public void qunFa() {
        //耗时
        for (UserInterface userInterface : list) {
            userInterface.getMsg(msg);
        }
    }
}
